NumberOfPackages = 10;
NumberOfNodes = 2;
Rate = 0.9;
MaxPackageRange = 5;
Result = zeros(1,MaxPackageRange);

syms k

for x=1:MaxPackageRange
    n = x;
    p = Rate;
    %Sum = symsum(factorial(n)/(factorial(n-k)*factorial(k)) * p^k * (1-p)^(n-k),k,1,n);
    Sum = symsum(factorial(n)/(gamma(n-k+1)*gamma(k+1)) * p^k * (1-p)^(n-k),k,1,n);
    Result(x) = Sum^(NumberOfNodes*NumberOfPackages);
end

plot(1:MaxPackageRange,Result)
